package net.oschina.app.pages;

import android.media.Image;
import android.widget.ImageView;
import android.widget.TextView;

import net.oschina.app.SoloWrap;

/**
 * Created by Aaron on 2017/3/5.
 */

public class PageMyLogin {
    private SoloWrap solo;
    TextView nickTV;
    ImageView settings;

    public PageMyLogin(SoloWrap solo){
        this.solo = solo;
    }

    public void initViews(){
        solo.waitForText("我的团队");
        nickTV = (TextView) solo.getView("net.oschina.app:id/tv_nick");
        settings = (ImageView) solo.getView("net.oschina.app:id/iv_logo_setting");
    }

    public void clickSettings(){
        solo.clickOnView(settings);
    }

    public String getNickName(){
        return nickTV.getText().toString();
    }

    public boolean isLoginStatus(){
        if(nickTV.isShown() && "autotest".equals(getNickName())){
            return true;
        }
        return false;
    }
}
